<template>
  <div>
    <div v-if="obj.state != 0">
      <el-descriptions title="快递信息">
        <el-descriptions-item label="快递承运：">
          <span>{{obj.name}}</span>
        </el-descriptions-item>
        <el-descriptions-item label="订单号：">{{obj.logorderNumber}}</el-descriptions-item>
        <el-descriptions-item label="物流单号：" v-if="obj.orderType !=1">{{obj.logisticCode}}
        </el-descriptions-item>
      </el-descriptions>
      <el-steps direction="vertical" finish-status="success" :active="obj.active">
        <el-step :title="obj.orderType !=1?item.acceptTime:parseTime(item.createTime)"
          v-for="(item,index) in obj.traces" :key="index"
          :description="obj.orderType !=1?item.acceptStation:item.sendMessage">
        </el-step>
      </el-steps>
    </div>
    <div v-else>
      <el-descriptions title="快递信息">
        <el-descriptions-item label="快递承运：">
          {{obj.orderType !=1?obj.name:"商家配送"}}
        </el-descriptions-item>
        <el-descriptions-item label="订单号：">{{obj.logorderNumber}}</el-descriptions-item>
        <el-descriptions-item label="物流单号："
          v-if="obj.orderType !=1">{{obj.logisticCode}}</el-descriptions-item>
      </el-descriptions>
      <el-steps finish-status="success" direction="vertical" :active="1">
        <el-step :title="parseTime(obj.createTime)" description="订单支付成功">
        </el-step>
      </el-steps>
    </div>
  </div>
</template>
 
<script setup>
import { reactive, getCurrentInstance, onMounted, inject, computed } from "vue";

const logisticsDeli = inject("logisticsDeli");
const obj = ref({});
watch(
  () => logisticsDeli.value,
  (newValue) => {
    obj.value = logisticsDeli.value;
  },
  { deep: true }
);
onMounted(async () => {
  await nextTick();
  obj.value = logisticsDeli.value;
});
</script>
<style scoped lang="scss">
</style>